<div id="content">
	<div class="row s_page_title">
		<sa-big-breadcrumbs [items]="['项目管理','项目运维厂区负责人']" icon="fa fa-smile-o" class="col-xs-12 col-sm-7 col-md-7 col-lg-4"></sa-big-breadcrumbs>
	</div>
	<sa-widgets-grid>
		<div class="s_table">
			<div sa-widget [editbutton]="false" color="darken" class="clearfix">
				<header>
					<span class="widget-icon"> <i class="fa fa-table"></i> </span>
					<h2>项目运维厂区负责人</h2>
				</header>
				<div>
					<div class="widget-body no-padding">
						<div class="page-header clearfix s_table_opreation">
							<div class="left page-header-btn">
								<div class="top_module">
									<span class="module_text">厂区名称</span>
									<sa-company-tree companyTreeId="companyTree" (companySelected)="companySelected($event)"></sa-company-tree>
								</div>
								<div class="top_module top_module_box">
									<span class="module_text">运维人员</span>
                  <sa-select2 select2ElementID="leaderSelectId" (optionSelected)="optionTableSearch($event)" [dataList]="companyList" [paramFormat]="paramFormat" matchSearch="true">
                  </sa-select2>
								</div>
								<button class="btn btn-primary" (click)="table_search()">查询</button>
								<button class="btn btn-primary" (click)="table_add(CorporateAccountModal)">新增</button>
								<button class="btn btn-primary" (click)="tableExport()">导出</button>
								<button class="btn btn-primary" (click)="table_export(ExportAccountModal)">未处理订单导出</button>
							</div>
						</div>
						<div class="table_scroll">
							<table class="display dataTables responsive table table-striped table-bordered table-hover dataTable s_h5_table">
								<thead>
									<tr>
										<th>对接厂区</th>
										<th>项目名称</th>
										<th>运维人员</th>
										<th>备注</th>
										<th>创建时间</th>
										<th>创建人</th>
										<th>操作</th>
									</tr>
								</thead>
								<tbody>
									<tr *ngFor="let row of tableData">
										<td>{{row.companyName}}</td>
										<td>{{row.fatherName}}</td>
										<td>{{row.name}}</td>
										<td>{{row.remark}}</td>
										<td>{{row.createTime}}</td>
										<td>{{row.createUserName}}</td>
										<td>
											<button type="button" (click)="editRow(row, CorporateAccountModal)">编辑</button>
											<button type="button" (click)="delRow(row)">刪除</button>
										</td>
									</tr>
								</tbody>
							</table>
						</div>
						<div class="table-fix clearfix">
							<paginator [totalRecords]="totalCount" [rows]="pageSize" [currentPage]="curPage - 1" (onPageChange)="paginate($event)">
							</paginator>
							<button type="button" class="btn default refresh_btn" (click)="refresh()"><i class="fa fa-refresh"></i></button>
						</div>
					</div>
				</div>
			</div>
		</div>
	</sa-widgets-grid>


	<!--    弹窗-->
	<section bsModal #CorporateAccountModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="modalClose(CorporateAccountModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">新增运维负责人</h4>
				</div>
				<form class="form-horizontal" role="form" novalidate="novalidate">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="form-group col-xs-12" id="controlTreeCompany">
								<label class="control-label col-xs-2">负责厂区<sup>*</sup></label>
								<div class="col-xs-10">
									<input class="form-control" *ngIf="editStatus" disabled [(ngModel)]='companyText' name='companyText' />
									<sa-company-tree-checkbox *ngIf="!editStatus" wrap="html" companyTreeId="companyTreeFrom" [Height]="32" [companyValue]="companyArrays" (companySelected)="addCompanySelected($event)"></sa-company-tree-checkbox>
								</div>
							</div>
              <div class="form-group col-xs-12 s_fix_select2">
								<label class="control-label col-xs-2" for="newPassword">负责人<sup>*</sup></label>
								<div class="col-xs-10 s_fix_select2_width s_fix_select2 ">
									<sa-select2 select2ElementID="leaderSelectId2" (optionSelected)="optionSelectedForm($event)" [dataList]="companyList" [paramFormat]="paramFormat" matchSearch="true">
									</sa-select2>
								</div>
							</div>
							<div class="form-group col-xs-12">
								<label class="col-xs-2 control-label">备注</label>
								<div class="col-xs-10 insert_text">
									<input class="form-control" [(ngModel)]='CorporateAccountFrom.remark' name='remark' />
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="modalClose(CorporateAccountModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="apiControlSubmit(CorporateAccountModal)">确认</button>
					</div>
				</form>
			</div>
		</div>
	</section>
	<!--  弹窗end-->

	<!--导出弹窗-->
	<section bsModal #ExportAccountModal="bs-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myExportModalLabel" aria-hidden="true">
		<div class="modal-dialog modal-lg">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" (click)="modalClose(ExportAccountModal)" aria-label="Close"><span aria-hidden="true">&times;</span></button>
					<h4 class="modal-title">导出</h4>
				</div>
				<form class="form-horizontal" role="form" novalidate="novalidate">
					<div class="modal-body">
						<div class="row form-horizontal">
							<div class="selectDate top_module">
								<div class="input-daterange input-group s_selected_time_box s_hover_box">
									<input type="text" autocomplete="off" [(ngModel)]='startTime' class="form-control s_selected_time" id="datetimepicker1" placeholder="请选择开始时间" name="startTime"/>
									<span class="s_selected_time_spe">至</span>
									<input type="text" autocomplete="off" [(ngModel)]='endTime' class="form-control s_selected_time" id="datetimepicker2" placeholder="请选择结束时间" name="endTime"/>
									<div class="s_del_icon" (click)='del_date()'>x</div>
								</div>
							</div>
						</div>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" (click)="modalClose(ExportAccountModal)">取消</button>
						<button type="button" class="btn btn-primary" (click)="exportData(ExportAccountModal)">确认</button>
					</div>
				</form>
			</div>
		</div>
	</section>
	<!--  弹窗end-->
</div>